#include <iostream>
using namespace std;
#include <vector>






bool process(vector<int>& arr , int index , int count , int num)
{ 
  int N = static_cast<int>(arr.size());
  if (count == N)
  {
    return true;
  }

  if (num < 0)
  {
    return false;
  }

  index %= N;
  num += arr[index];

  return process(arr , index + 1 , count + 1 , num);
}


int main()
{
  vector<int> arr = {-1 , -1 , 2 , 0};
  cout << process(arr , 3 , 0 , 0) << endl;
  return 0;
}
